home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume18 / mush6.4 / part10 < prev    next >
Encoding:
Internet Message Format  |  1989-03-12  |  48.8 KB

  1. Subject:  v18i032:  Mail user's shell version 6.4, Part10/19
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: Dan Heller <island!argv@sun.com>
  7. Posting-number: Volume 18, Issue 32
  8. Archive-name: mush6.4/part10
  9.  
  10.  
  11.  
  12. #! /bin/sh
  13. # This is a shell archive.  Remove anything before this line, then unpack
  14. # it by saving it into a file and typing "sh file".  To overwrite existing
  15. # files, type "sh file -c".  You can also feed this as standard input via
  16. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  17. # will see the following message at the end:
  18. #        "End of archive 10 (of 19)."
  19. # Contents:  mush.h tool_help
  20. # Wrapped by rsalz@papaya.bbn.com on Mon Mar 13 19:25:16 1989
  21. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  22. if test -f 'mush.h' -a "${1}" != "-c" ; then 
  23.   echo shar: Will not clobber existing file \"'mush.h'\"
  24. else
  25. echo shar: Extracting \"'mush.h'\" \(23119 characters\)
  26. sed "s/^X//" >'mush.h' <<'END_OF_FILE'
  27. X/* @(#)mush.h    (c) copyright 1986 (Dan Heller) */
  28. X
  29. X#define VERSION "Mail User's Shell (6.4 2/14/89)"
  30. X
  31. X#include "config.h"
  32. X
  33. X#ifdef CURSES
  34. X
  35. X#ifdef USG
  36. X#    define _USG
  37. X#    undef USG
  38. X#endif /* USG */
  39. X#ifdef SYSV
  40. X#    define _SYSV
  41. X#    undef SYSV
  42. X#endif /* SYSV */
  43. X#include <curses.h>
  44. X#if !defined(USG) && defined(_USG)
  45. X#    define USG
  46. X#endif /* USG */
  47. X#if !defined(SYSV) && defined(_SYSV)
  48. X#    define SYSV
  49. X#endif /* SYSV */
  50. X
  51. X#else /* CURSES */
  52. X#include <stdio.h>
  53. X#if defined(SYSV) && defined(USG)
  54. X#include <termio.h>
  55. X#endif /* SYSV && USG */
  56. X#endif /* CURSES */
  57. X
  58. X#include <ctype.h>
  59. X#include <errno.h>
  60. X#include <setjmp.h>
  61. X#include "strings.h"
  62. X
  63. X#ifdef SUNTOOL
  64. X#    include <suntool/tool_hs.h>
  65. X#else  /* SUNTOOL */
  66. X#    include <sys/types.h>
  67. X#    include <signal.h>
  68. X#    ifndef SYSV
  69. X#        include <sys/time.h>
  70. X#     include <sys/ioctl.h>   /* for ltchars */
  71. X#    else
  72. X#        include <time.h>
  73. X#        include <fcntl.h>
  74. X#    endif /* SYSV */
  75. X#endif /* SUNTOOL */
  76. X
  77. X#include <sys/stat.h>
  78. X#include <sys/file.h>
  79. X
  80. X#ifdef SUNTOOL
  81. X#    include <suntool/gfxsw.h>
  82. X#    include <suntool/panel.h>
  83. X#    include <suntool/ttysw.h>
  84. X#    include <suntool/ttytlsw.h>
  85. X#    include <suntool/menu.h>
  86. X#    include <suntool/icon_load.h>
  87. X#endif /* SUNTOOL */
  88. X
  89. X/* if no maximum number of files can be found, we'll use getdtablesize() */
  90. X#ifdef _NFILE
  91. X#    define MAXFILES _NFILE
  92. X#else
  93. X#ifdef NOFILE
  94. X#    define MAXFILES NOFILE
  95. X#endif /* NOFILE */
  96. X#endif /* _NFILE */
  97. X
  98. X#ifndef MAXPATHLEN
  99. X#define MAXPATHLEN BUFSIZ
  100. X#endif /* MAXPATHLEN */
  101. X
  102. X#ifdef CTRL
  103. X#undef CTRL
  104. X#endif /* CTRL */
  105. X#define CTRL(c)        ('c' & 037)
  106. X
  107. X#define ESC         '\033'
  108. X
  109. X#define NO_STRING    ""
  110. X#ifdef  NULL
  111. X#undef  NULL
  112. X#endif /* NULL */
  113. X#define NULL        (char *)0
  114. X#define NULL_FILE    (FILE *)0
  115. X#define DUBL_NULL    (char **)0
  116. X#define TRPL_NULL    (char ***)0
  117. X#ifdef putchar
  118. X#undef putchar
  119. X#endif /* putchar */
  120. X#define putchar(c)    fputc(c, stdout), fflush(stdout)
  121. X#define bell()         fputc('\007', stderr), fflush(stderr)
  122. X
  123. X/* For error recovery purposes, send keyboard generated signals to a special
  124. X * routine (interrupt) to set a global flag (WAS_INTR) and return to the
  125. X * calling routine which is responsible for checking the flag.  For both
  126. X * on_intr() and off_intr() macros, initialize WAS_INTR to false.
  127. X */
  128. X#define on_intr() \
  129. X    turnoff(glob_flags, WAS_INTR), oldint = signal(SIGINT, intrpt), \
  130. X    oldquit = signal(SIGQUIT, intrpt)
  131. X
  132. X#define off_intr() \
  133. X    turnoff(glob_flags, WAS_INTR), (void) signal(SIGINT, oldint), \
  134. X    (void) signal(SIGQUIT, oldquit)
  135. X
  136. X/* Don't flush input when setting echo or cbreak modes (allow typeahead) */
  137. X#ifdef TIOCSETN
  138. X#ifdef stty
  139. X#undef stty
  140. X#endif /* stty */
  141. X#define stty(fd, sgttybuf)    (ioctl(fd, TIOCSETN, sgttybuf))
  142. X#endif /* TIOCSETN */
  143. X
  144. X/* for system-V machines that run termio */
  145. X#if defined(SYSV) && defined(USG)
  146. Xunsigned char vmin, vtime;
  147. X#define sg_erase  c_cc[2]
  148. X#define sg_flags  c_lflag
  149. X#define sg_kill   c_cc[3]
  150. X#define sg_ospeed c_cflag
  151. X#define gtty(fd, SGTTYbuf)    ioctl(fd, TCGETA, SGTTYbuf)
  152. X#undef stty
  153. X#define stty(fd, SGTTYbuf)    ioctl(fd, TCSETAW, SGTTYbuf)
  154. X#define echon()    (_tty.sg_flags |= (ECHO|ECHOE),    stty(0, &_tty))
  155. X#define echoff()   (_tty.sg_flags &= ~ECHO,   stty(0, &_tty))
  156. X#define cbrkon()   \
  157. X    (_tty.sg_flags &= ~ICANON, _tty.c_cc[VMIN] = 1, stty(0, &_tty))
  158. X#define cbrkoff()  \
  159. X    (_tty.sg_flags |= ICANON, _tty.c_cc[VMIN] = vmin, \
  160. X    _tty.c_cc[VTIME] = vtime, stty(0, &_tty))
  161. X#define savetty()  \
  162. X    (void) gtty(0, &_tty), vtime = _tty.c_cc[VTIME], vmin = _tty.c_cc[VMIN]
  163. X#define cbreak()   cbrkon()
  164. X#define nocbreak() cbrkoff()
  165. X
  166. X/* If curses isn't defined, declare our 'tty' and macros for echo/cbreak */
  167. X#ifndef CURSES
  168. Xtypedef struct termio SGTTY;
  169. X#define echom()    echon()
  170. X#define noechom()  echoff()
  171. X#define crmode()   cbrkon()
  172. X#define nocrmode() cbrkoff()
  173. X
  174. X#else /* CURSES */
  175. X/* If curses is defined, use the echo/cbreak commands in library only
  176. X * if curses is running.  If curses isn't running, use macros above.
  177. X */
  178. X#define echom()    ((iscurses) ? echo(): echon())
  179. X#define noechom()  ((iscurses) ? noecho(): echoff())
  180. X#define crmode()   ((iscurses) ? cbreak() : cbrkon())
  181. X#define nocrmode() ((iscurses) ? nocbreak() : cbrkoff())
  182. X#endif /* CURSES */
  183. X#endif /* SYSV && USG */
  184. X
  185. X#if !defined(USG)
  186. X#ifndef CURSES
  187. X/* if curses is not defined, simulate the same tty based macros */
  188. Xtypedef struct sgttyb SGTTY;
  189. X/* Do real ioctl calls to set the tty modes */
  190. X#define crmode()   (_tty.sg_flags |= CBREAK,  stty(0, &_tty))
  191. X#define nocrmode() (_tty.sg_flags &= ~CBREAK, stty(0, &_tty))
  192. X#define echom()    (_tty.sg_flags |= ECHO,    stty(0, &_tty))
  193. X#define noechom()  (_tty.sg_flags &= ~ECHO,   stty(0, &_tty))
  194. X#define savetty()  (void) gtty(0, &_tty)
  195. X#else /* CURSES */
  196. X#define echom()    echo()
  197. X#define noechom()  noecho()
  198. X#endif /* ~CURSES */
  199. X#endif /* ~USG */
  200. X
  201. X/* With all that out of the way, we can now declare our tty type */
  202. XSGTTY _tty;
  203. X
  204. Xextern char
  205. X    del_line,        /* tty delete line character */
  206. X    del_word,        /* tty delete word character */
  207. X    del_char,        /* backspace */
  208. X    reprint_line,    /* usually ^R */
  209. X    eofc,        /* usually ^D */
  210. X    lit_next;        /* usually ^V */
  211. X
  212. X/* These macros now turn on/off echo/cbreak independent of the UNIX running */
  213. X#define echo_on()    \
  214. X    if (_tty.sg_flags && isoff(glob_flags, ECHO_FLAG)) nocrmode(), echom()
  215. X#define echo_off()    \
  216. X    if (_tty.sg_flags && isoff(glob_flags, ECHO_FLAG)) crmode(), noechom()
  217. X
  218. X#define strdup(dst, src) (xfree (dst), dst = savestr(src))
  219. X#define Debug        if (debug) printf
  220. X
  221. X#ifdef SYSV
  222. X#ifndef L_SET
  223. X#define L_SET    0
  224. X#endif /* L_SET */
  225. X#ifndef F_OK
  226. X#define F_OK    000
  227. X#define R_OK    004
  228. X#define W_OK    002
  229. X#define E_OK    001
  230. X#endif /* F_OK */
  231. Xtypedef    unsigned long    u_long;
  232. X#define vfork   fork
  233. X#ifndef SIGCHLD
  234. X#define SIGCHLD SIGCLD
  235. X#endif /* SIGCHLD */
  236. X#endif /* SYSV */
  237. X
  238. X#if !defined(SUNTOOL) && !defined(CURSES)
  239. X
  240. X#define TRUE          1
  241. X#define FALSE          0
  242. X#define print          printf
  243. X#define wprint          printf
  244. X#define print_more      printf
  245. X
  246. X#endif /* SUNTOOL && !CURSES */
  247. X
  248. X#ifndef max
  249. X#define max(a,b) (((a) > (b)) ? (a) : (b))
  250. X#define min(a,b) (((a) < (b)) ? (a) : (b))
  251. X#endif /* max */
  252. X
  253. X#if defined(CURSES) && !defined(SUNTOOL)
  254. X#define wprint printf
  255. X#endif /* !SUNTOOL && CURSES */
  256. X
  257. X#if defined(CURSES) || defined(SUNTOOL)
  258. X#define print_more      turnon(glob_flags, CONT_PRNT), print
  259. Xvoid print();        /* printf to window or curses or tty accordingly */
  260. X#endif /* CURSES || SUNTOOL */
  261. X
  262. X#ifdef  SUNTOOL
  263. X
  264. X#define NO_ITEM          (Panel_item)0
  265. X#define NO_EVENT      (struct inputevent *)0
  266. X#define TIME_OUT      60           /* sleep 60 secs between mailchecks */
  267. X#define PIX_XOR          PIX_SRC ^ PIX_DST
  268. X#define ID           event.ie_code
  269. X#define l_width(font)      fonts[font]->pf_defaultsize.x /* width of letter */
  270. X#define l_height(font)      fonts[font]->pf_defaultsize.y /* height of letter */
  271. X#define Clrtoeol(w,x,y,f) pw_text(w, x, y, PIX_SRC, fonts[f], blank)
  272. X#define type_cursor(op)   pw_char(msg_win, txt.x,txt.y, op, fonts[curfont],'_')
  273. X
  274. X#define highlight(win,x,y,font,s) \
  275. X    pw_text(win,x,y, PIX_SRC, fonts[font],s), \
  276. X    pw_text(win,x+1,y, \
  277. X    (ison(glob_flags, REV_VIDEO))? PIX_NOT(PIX_SRC): PIX_SRC|PIX_DST, \
  278. X    fonts[font],s)
  279. X
  280. X/* Fonts */
  281. X#define FONTDIR          "/usr/lib/fonts/fixedwidthfonts"
  282. X#define DEFAULT          0
  283. X#define SMALL           1
  284. X#define LARGE           2
  285. X#define MAX_FONTS      3
  286. X
  287. X#endif /* SUNTOOL */
  288. X
  289. X/* bits and pieces */
  290. X#define turnon(flg,val)   ((flg) |= ((u_long)1 << ((u_long)(val)-1L)))
  291. X#define turnoff(flg,val)  ((flg) &= ~((u_long)1 << ((u_long)(val)-1L)))
  292. X#define ison(flg,val)     ((u_long)(flg) & ((u_long)1 << ((u_long)(val)-1L)))
  293. X#define isoff(flg,val)    (!ison((flg), (val)))
  294. X#define set_replied(n)      \
  295. X    if (isoff(msg[n].m_flags, REPLIED)) \
  296. X        turnon(glob_flags, DO_UPDATE), turnon(msg[n].m_flags, REPLIED)
  297. X#define set_isread(n)      \
  298. X    if (ison(msg[n].m_flags, UNREAD)) \
  299. X        turnon(glob_flags, DO_UPDATE), turnoff(msg[n].m_flags, UNREAD)
  300. X
  301. X#define in_pipe() (ison(glob_flags, DO_PIPE) || ison(glob_flags, IS_PIPE))
  302. X#define in_macro() (ison(glob_flags, LINE_MACRO) || ison(glob_flags, IN_MACRO))
  303. X#define line_macro(s) (turnon(glob_flags, LINE_MACRO), mac_push(s))
  304. X#define curs_macro(s) (turnon(glob_flags, IN_MACRO), mac_push(s))
  305. X#define Ungetstr(s) (turnon(glob_flags, QUOTE_MACRO), mac_push(s))
  306. X
  307. X/* msg lists represented by bits (8 should be replaced by sizeof(char) */
  308. X#define clear_msg_list(list)      (void) (bzero(list, (msg_cnt+7)/8))
  309. X#define msg_bit(list, n)    ((list[(n) / 8] >> ((n) % 8)) & 1)
  310. X#define set_msg_bit(list, n)    (list[(n) / 8] |= (1 << ((n) % 8)))
  311. X#define unset_msg_bit(list, n)  (list[(n) / 8] &= ~(1 << ((n) % 8)))
  312. X#define bput(S1, S2, Len, op)                   \
  313. X        {                         \
  314. X            register char *s1 = S1, *s2 = S2;         \
  315. X            register int len = Len;             \
  316. X            while(len--)                 \
  317. X            *s2++ op *s1++;             \
  318. X        }
  319. X#define bitput(m1,m2,len,op)    bput(m1, m2, (((len)+7)/8), op)
  320. X
  321. X/* convenience and/or readability */
  322. X#define when          break;case
  323. X#define otherwise      break;default
  324. X#define lower(c)      (isupper(c)? tolower(c): c)
  325. X#define Lower(c)      (c = lower(c))
  326. X#define upper(c)      (islower(c)? toupper(c): c)
  327. X#define Upper(c)      (c = upper(c))
  328. X#define skipspaces(n)     for(p += (n); *p == ' ' || *p == '\t'; ++p)
  329. X#define skipdigits(n)     for(p += (n); isdigit(*p); ++p)
  330. X#define ismsgnum(c)       (isdigit(c)||c=='.'||c=='^'||c=='$'||c=='*')
  331. X#define skipmsglist(n)\
  332. X    for(p += (n); ismsgnum(*p) || index(" \t,-{`}", *p); ++p)\
  333. X    if (*p != '`' || !p[1]) {;} else do ++p; while (*p && *p != '`')
  334. X
  335. X#define NO_FLG        0
  336. X
  337. X/* various flags */
  338. Xu_long   glob_flags;    /* global boolean flags thruout the whole program */
  339. X#define DO_UPDATE   1    /* check for changes to avoid unnecessary copyback */
  340. X#define REV_VIDEO   2    /* reverse video for curses or toolmode */
  341. X#define CONT_PRNT   3    /* continue to print (maybe a printf) without a '\n' */
  342. X#define DO_SHELL    4    /* run a shell even if no mail? (true if tool) */
  343. X#define DO_PIPE     5    /* true if commands are piping to another command */
  344. X#define IS_PIPE     6    /* true if commands' "input" is piped from another */
  345. X#define IGN_SIGS    7    /* true if catch() should not longjmp */
  346. X#define IGN_BANG    8    /* ignore ! as a history reference (see source()) */
  347. X#define ECHO_FLAG   9    /* if true, echo|cbreak is ON, echo typing (-e) */
  348. X#define IS_GETTING 10    /* true if we're getting input for a letter */
  349. X#define PRE_CURSES 11    /* true if curses will be run, but hasn't started yet */
  350. X#define READ_ONLY  12    /* -r passed to folder() (or main) setting read only */
  351. X#define REDIRECT   13    /* true if stdin is being redirected */
  352. X#define WAS_INTR   14    /* catch interrupts, set this flag (signals.c) */
  353. X#define WARNING    15   /* if set, various warning messages may be printed */
  354. X#define NEW_MAIL   17   /* new mail has arrived; user is busy or in icon mode */
  355. X#define CNTD_CMD   18   /* curses.c -- "...continue..." prompt in curses */
  356. X#define IS_SENDING 19   /* was started to send mail, not to be run as a shell */
  357. X#define MIL_TIME   20    /* if $mil_time is set, use 24hr military time fmt */
  358. X#define DATE_RECV  21   /* if $date_received, show date received on msgs */
  359. X#define IN_MACRO   22    /* input is currently being read from a macro */
  360. X#define LINE_MACRO 23    /* escape to line mode from curses mode in progress */
  361. X#define QUOTE_MACRO 24  /* protect current macro from recursive expansion */
  362. X
  363. X#define VERBOSE        1       /* verbose flag for sendmail */
  364. X#define INCLUDE        2       /* include msg in response */
  365. X#define INCLUDE_H    3    /* include msg with header */
  366. X#define EDIT        4    /* enter editor by default on mailing */
  367. X#define SIGN        5    /* auto-include ~/.signature in mail */
  368. X#define DO_FORTUNE    6    /* add a fortune at end of msgs */
  369. X
  370. X/* msg flags */
  371. X#define NO_HEADER    7    /* don't print header of message (top, write) */
  372. X#define DELETE        8
  373. X#define OLD            9
  374. X#define UNREAD        10
  375. X#define UPDATE_STATUS    11    /* change status of msg when copyback */
  376. X#define NO_PAGE        12    /* don't page this message */
  377. X#define INDENT        13    /* indent included msg with string */
  378. X#define NO_IGNORE    14    /* don't ignore headers */
  379. X#define PRESERVE    15      /* preserve in mailbox unless deleted */
  380. X#define M_TOP        15    /* just print the top of msg (same as pre) */
  381. X#define FORWARD        16    /* Forward messages into the message buffer */
  382. X#define REPLIED        17    /* Messages that have been replied to */
  383. X#define NEW_SUBJECT    18    /* new subject regardless of $ask (mail -s) */
  384. X#define SAVED        19    /* when message has been saved */
  385. X#ifdef MSG_SEPARATOR
  386. X#define NO_SEPARATOR    20    /* don't include message separator lines */
  387. X#endif /* MSG_SEPARATOR */
  388. X
  389. X#define    MAXMSGS_BITS    MAXMSGS/sizeof(char)    /* number of bits for bitmap */
  390. X
  391. Xstruct msg {
  392. X    u_long m_flags;
  393. X    long   m_offset;    /* offset in tempfile of msg */
  394. X    long   m_size;    /* number of bytes in msg */
  395. X    int    m_lines;    /* number of lines in msg */
  396. X    char   *m_date_recv;/* Date user received msg (see dates.c for fmt) */
  397. X    char   *m_date_sent;/* Date author sent msg (see dates.c for fmt) */
  398. X} msg[MAXMSGS];
  399. X
  400. Xstruct options {
  401. X    char *option;
  402. X    char *value;
  403. X    struct options *next;
  404. X} *set_options, *aliases, *ignore_hdr, *functions, *fkeys, *own_hdrs;
  405. X#ifdef CURSES
  406. Xstruct options *bindings;
  407. X#endif /* CURSES */
  408. X
  409. Xstruct cmd {
  410. X    char *command;
  411. X    int (*func)();
  412. X};
  413. Xextern struct cmd ucb_cmds[];
  414. Xextern struct cmd cmds[], hidden_cmds[];
  415. X#ifdef SUNTOOL
  416. Xextern struct cmd fkey_cmds[];
  417. X#endif /* SUNTOOL */
  418. X
  419. XFILE
  420. X    *tmpf,        /* temporary holding place for all mail */
  421. X    *mask_fopen(),    /* open a file with umask 077 (permissions 600) */
  422. X    *open_file(),    /* open a file or program for write/append */
  423. X    *popen();        /* this should be in stdio.h */
  424. X
  425. Xextern char
  426. X    *sys_errlist[],    /* system's list of global error messages */
  427. X#ifdef SUNTOOL
  428. X    *font_files[],     /* the names of the files fonts are kept in */
  429. X    *alt_fonts[],     /* fonts to use if first ones don't work */
  430. X#endif /* SUNTOOL */
  431. X    **environ;        /* user's environment variables */
  432. X
  433. Xextern int errno;    /* global system error number */
  434. Xjmp_buf jmpbuf;        /* longjmp to jmpbuf on sigs (not in tool) */
  435. X
  436. Xchar
  437. X    debug,        /* debug causes various print statements in code */
  438. X    tempfile[MAXPATHLEN],    /* path to filename of temporary file */
  439. X    msg_list[MAXMSGS_BITS],    /* MAXMSGS bits of boolean storage */
  440. X    **alternates,    /* alternates list --see alts() */
  441. X    *cmd_help,        /* filename of location for "command -?" commands. */
  442. X    *login,        /* login name of user */
  443. X    *mailfile,        /* path to filename of current mailfile */
  444. X    **ourname,        /* the name and aliases of the current host */
  445. X    **known_hosts,    /* the names of all hosts connected via uucp */
  446. X    *prompt,        /* the prompt string -- may have %d */
  447. X    *escape,        /* the "tilde escape" when inputting text to letter */
  448. X    *hdrs_only,        /* true if -H flag was given --set to args */
  449. X    *hdr_format,    /* set to the header format string; referenced a lot */
  450. X    *spoolfile,        /* MAILDIR/$USER in a string -- this is used a lot */
  451. X    *msg_get(),        /* find start of message and return From_ line */
  452. X    *do_range(),    /* parse a string converting to a "range" of numbers */
  453. X    *getpath(),        /* static char returning path (expanding ~, +, %, #) */
  454. X    *do_set(),        /* set/unset an option, alias, ignored-hdr */
  455. X    *reverse(),        /* reverse a string */
  456. X    *prog_name,
  457. X
  458. X    /* from loop.c */
  459. X    **make_command(),    /* build a command vector (argv) */
  460. X    **mk_argv(),    /* given a string, make a vector */
  461. X    *variable_stuff(),    /* return information about variables */
  462. X    *check_internal(),    /* test or evaluate internal variables */
  463. X
  464. X    /* from dates.c */
  465. X    *Time(),        /* returns string expression of time (takes args) */
  466. X    *date_to_ctime(),    /* convert a date into ctime() format */
  467. X    *date_to_string(),    /* returns a string described by parse_date() */
  468. X    *msg_date(),    /* return a string of the date of a message */
  469. X    *parse_date(),    /* parse an ascii date, and return message-id str */
  470. X    *rfc_date(),    /* create a date string compliant to RFC822 */
  471. X
  472. X    /* from hdrs.c */
  473. X    *cc_to(),         /* when responding, return str which is the cc-list */
  474. X    *compose_hdr(),    /* returns a formatted line describing passed msg # */
  475. X    *header_field(),    /* the line in msg described by arg (message header) */
  476. X    *reply_to(),    /* who do we reply to when responding */
  477. X    *subject_to(),      /* when responding, return str which is the subject */
  478. X
  479. X    /* addrs.c */
  480. X    *alias_to_address(),/* convert a name[list] to "real" names */
  481. X    *bang_form(),    /* construct a !-style form of an address */
  482. X    *get_name_n_addr(), /* get name and addr from a well-formed address */
  483. X    *set_header(),     /* [interactive] proc to set/display to/subject/cc */
  484. X    *wrap_addrs();    /* insert newlines in between headers */
  485. X
  486. Xint
  487. X    last_msg_cnt,    /* when checking for new mail, save the last msg_cnt */
  488. X    msg_cnt,        /* total number of messages */
  489. X    crt,        /* min number of lines msg contains to invoke pager */
  490. X    current_msg,    /* the current message we're dealing with */
  491. X    exec_pid,        /* pid of a command that has been "exec"ed */
  492. X    hist_no,        /* command's history number */
  493. X    iscurses,        /* if we're running curses */
  494. X    istool,        /* argv[0] == "xxxxtool", ranges from 0 to 2 */
  495. X    n_array[128],    /* array of message numbers in the header window */
  496. X    screen,        /* number of headers window can handle */
  497. X    wrapcolumn,        /* compose mode line wrap, measured from left */
  498. X
  499. X    quit(), do_alias(), respond(), cd(), sh(), stop(),
  500. X    folder(), folders(), merge_folders(), do_undigest(),
  501. X    save_msg(), delete(), do_mail(), lpr(), alts(), set(), do_hdrs(),
  502. X    save_opts(), preserve(), sort(), readmsg(), edit_msg(), eval_cmd(),
  503. X    do_pick(), print_help(), question_mark(), do_from(), my_stty(),
  504. X    do_version(), disp_hist(), source(), do_echo(), ls(), pipe_msg(),
  505. X    nopenfiles(), Setenv(), Unsetenv(), Printenv(), msg_flags(), toggle_debug();
  506. X
  507. X#ifndef SIGRET
  508. X#define SIGRET int
  509. X#endif /* SIGRET */
  510. XSIGRET
  511. X#ifdef SUNTOOL
  512. X    sigtermcatcher(), sigwinchcatcher(),
  513. X#endif /* SUNTOOL */
  514. X    rm_edfile(), stop_start(), bus_n_seg(), sigchldcatcher(), catch(), intrpt();
  515. X
  516. Xlong
  517. X    still_more,        /* there is still more message to display */
  518. X    spool_size,        /* size of spool mail regardless of current folder */
  519. X    last_size,        /* the last size of the mailfile since last check */
  520. X    time();        /* satisfy lint */
  521. X
  522. Xvoid
  523. X    error(), getmail(), mail_status(), close_lock(),
  524. X    file_to_fp(), init(), display_msg(), cleanup(), fs_error();
  525. X    /* printf(), fclose(), fflush(), fputs(), fputc() */
  526. X#ifdef TIOCGLTC
  527. Xstruct ltchars ltchars;            /* tty character settings */
  528. X#endif /* TIOCGLTC */
  529. X#ifdef BSD /* (TIOCGETC) */
  530. Xstruct tchars  tchars;            /* more tty character settings */
  531. X#endif /* BSD (TIOCGETC) */
  532. X
  533. X#ifdef CURSES
  534. X
  535. X#define STANDOUT(y,x,s) standout(), mvaddstr(y,x,s), standend()
  536. X#define redraw()    clearok(curscr, TRUE), wrefresh(curscr)
  537. X
  538. Xint
  539. X    curses_init();    /* interpret commands via the curses interface */
  540. X#endif /* CURSES */
  541. X
  542. Xint
  543. X    mac_push(),        /* set up a string as a macro */
  544. X    bind_it();        /* bind strings to functions or macros */
  545. X
  546. Xvoid
  547. X    mac_flush();    /* Abandon macro processing (on error) */
  548. X
  549. X#ifdef SUNTOOL
  550. Xvoid
  551. X    lock_cursors(), unlock_cursors(), scroll_win(),
  552. X    set_fkeys(), set_key(), toggle_opt(), help_opt();
  553. X
  554. Xchar
  555. X    *rite(),        /* rite a char to msg_win: return string if c == '\n' */
  556. X    *find_key(),    /* pass x,y coords to find which function key assoc. */
  557. X    *key_set_to(),    /* pass fkey string, return string describing func */
  558. X    *panel_get(),          /* returns what has been typed in a panel item */
  559. X    *tool_help,        /* help for tool-related things (sometimes, overlap) */
  560. X    blank[128];        /* use to clear to end of line */
  561. X
  562. Xint
  563. X    time_out,        /* time out interval to wait for new mail */
  564. X    rootfd,        /* the root window's fd */
  565. X    parentfd,        /* the parent's window fd */
  566. X    getting_opts,    /* true if getting/setting opts from msg_win */
  567. X    curfont,        /* the current font to use for mail message window */
  568. X    total_fonts,    /* total number of fonts available */
  569. X    get_hdr_field,    /* bitmask of header fields to be gotten */
  570. X
  571. X    msg_io(), msgwin_handlesigwinch(), hdr_io(), hdrwin_handlesigwinch(),
  572. X    do_compose(), do_edit(), read_mail(), delete_mail(), respond_mail(),
  573. X    do_hdr(), display_hdrs(), print_sigwinch(), p_set_opts(),
  574. X    tool_mgmt(), do_help(), text_done(), msg_num_done(), do_lpr(),
  575. X    toolquit(), change_font(), do_clear(), do_update(), do_sort(),
  576. X    file_dir(), do_file_dir(), do_send(), abort_mail(), check_new_mail(),
  577. X    fkey_cmd(), fkey_settings();
  578. X
  579. Xstruct tool *tool;      /* main tool structure */
  580. Xstruct toolsw
  581. X    *panel_sw,        /* main panel subwindow */
  582. X    *hdr_sw,         /* subwindow for message headers */
  583. X    *hdr_panel_sw,    /* panel for headers */
  584. X    *tty_sw,         /* subwindow which forks a shell (usually editor) */
  585. X    *print_sw,         /* subwindow for print statements */
  586. X    *msg_sw;         /* main subwindow to display messages and more */
  587. X
  588. Xstruct pixwin
  589. X    *msg_win,        /* main pixwin for message display and more */
  590. X    *hdr_win,        /* pixwin for message headers */
  591. X    *print_win;        /* pixwin for printing messages ( print() ) */
  592. X
  593. Xstruct pr_pos txt;               /* current position of text written */
  594. Xstruct rect msg_rect, hdr_rect;         /* sizes of the main and hdr rects */
  595. Xstruct pixfont *fonts[MAX_FONTS];    /* array of fonts */
  596. X
  597. XPanel
  598. X    main_panel,        /* the main panel dealing with generic items */
  599. X    hdr_panel;        /* panel which contains message header specific items */
  600. X
  601. XPanel_item
  602. X    abort_item,        /* abort mail in progress */
  603. X    alias_item,        /* set/view/change current mail aliases */
  604. X    cd_item,        /* changes file_item to cd (for cd-ing) */
  605. X    comp_item,        /* compose a letter */
  606. X    delete_item,    /* delete/undelete messages */
  607. X    edit_item,        /* edit a message */
  608. X    font_item,        /* choose which font to use */
  609. X    folder_item,    /* change folders */
  610. X    file_item,         /* text item for files or directories (folder/cd) */
  611. X    hdr_display,    /* format message headers are displayed */
  612. X    help_item,        /* choose this to get various help */
  613. X    ignore_item,    /* set/view/change message headers to be ignored */
  614. X    input_item,        /* text item to get values for set/unsetting values */
  615. X    msg_num_item,    /* text item to explicitly state which message to read */
  616. X    next_scr,        /* display the next screenful of message headers */
  617. X    option_item,    /* set/view/unset mail options */
  618. X    prev_scr,        /* display the previous screen of messages */
  619. X    print_item,        /* send current message to the printer */
  620. X    quit_item,        /* quit tool/close to icon */
  621. X    read_item,        /* read the current message */
  622. X    respond_item,    /* respond to messages */
  623. X    save_item,        /* saves messages; uses text item input_item */
  624. X    send_item,        /* when composing letter, this will send it off */
  625. X    sort_item,        /* sort routine... */
  626. X    sub_hdr_item[6],    /* display items that just sit there and give help */
  627. X    update_item;    /* commit changes to folder */
  628. X
  629. Xstruct itimerval mail_timer;    /* frequency to check for new mail */
  630. X
  631. X            /* mouse symbols and data */
  632. X/* left, middle and right mouse pixrects */
  633. Xstruct cursor
  634. X    l_cursor, m_cursor, r_cursor, coffee, read_cursor, write_cursor,
  635. X    main_cursor, checkmark;
  636. X
  637. Xstruct pixrect *msg_pix; /* pixrect holding text of a message */
  638. Xextern struct pixrect mouse_left, mouse_middle, mouse_right;
  639. Xextern struct pixrect dn_arrow, up_arrow, cycle, shade_50;
  640. X
  641. Xextern struct icon mail_icon;
  642. X#endif /* SUNTOOL */
  643. END_OF_FILE
  644. if test 23119 -ne `wc -c <'mush.h'`; then
  645.     echo shar: \"'mush.h'\" unpacked with wrong size!
  646. fi
  647. # end of 'mush.h'
  648. fi
  649. if test -f 'tool_help' -a "${1}" != "-c" ; then 
  650.   echo shar: Will not clobber existing file \"'tool_help'\"
  651. else
  652. echo shar: Extracting \"'tool_help'\" \(23733 characters\)
  653. sed "s/^X//" >'tool_help' <<'END_OF_FILE'
  654. X@(#)tool_help    (c) copyright 10/18/86 (Dan Heller)
  655. X
  656. X%general%
  657. X
  658. X      IF ALL ELSE FAILS, READ THE DIRECTIONS!
  659. X
  660. XThis famous  quote applies here more  than ever. If
  661. Xyou are unfamiliar with this mailtool, get yourself
  662. Xacquainted with it by choosing  HELP options in all
  663. Xmenu items. If you get frustrated or confused about
  664. Xhow to use or run a command, or if you want to know
  665. Xhow something  works or get to know quick shortcuts
  666. Xin achieving tasks, it is  advisable to look at the
  667. XHelp option available with the item.
  668. X
  669. XSince there  are many different  options to some of
  670. Xthe commands in  mailtool, explanation  of  options
  671. Xfor the commands can be found by choosing the RIGHT
  672. Xmouse button over an item. This will display a menu
  673. Xof options for the command. One of the menu options
  674. Xwill almost always be a Help option.
  675. X
  676. XGive yourself a head start, try selecting this same
  677. Xitem with the RIGHT mouse button.  When you do, you
  678. Xwill given some more help topics to choose from.
  679. X%%
  680. X
  681. X%help%
  682. XHelp was designed for users to get  help from anywhere on  the mailtool
  683. Xwindow.  The RIGHT mouse button may be selected on virtually every -
  684. X on any of the windows on the entire tool and  a menu will appear.
  685. XThe last item in almost  every menu  is a "help" item.  You will get an
  686. Xappropriate help message describing what you can do at the position you
  687. Xare in on the mailtool window.
  688. X
  689. XIf a help  message isn't much help, it may be more helpful to reference
  690. Xa different help item which  describes in more detail  what you want to
  691. Xknow.  For example, reading the help for  "folder" will help you better
  692. Xunderstand  the method in  which mail messages are stored than it would
  693. Xif you had read the help message for "save" first.
  694. X%%
  695. X
  696. X%mouse%
  697. XThe mouse is an image (cursor) which moves across the screen. Its
  698. Xposition indicates which window is to receive input when you type
  699. Xor click a mouse button.
  700. X
  701. XThe mouse may take upon  different images which  indicate various
  702. Xthings. When the image looks like a "coffee cup",  Mushtool is in
  703. Xthe process of doing something,  like sending mail, or reading in
  704. Xnew mail.  In this event, you should wait till the cursor returns
  705. Xto its normal state before attempting to do anything else. Go get
  706. Xsome coffee.
  707. X
  708. XWhen the mouse looks like a pair of glasses, you are reading mail
  709. Xand when it looks like a pencil, you  are editing a letter.  When
  710. Xin the  Header Window, the cursor will look like the mouse device
  711. Xthat you hold  with the buttons  flashing on and off.  This is to
  712. Xremind  you that you  can use each button  to do different tasks.
  713. X
  714. XIn one window, the Main Panel Window, the cursor image looks like
  715. Xan envelope.  Placing the cursor over "Panel Items" and selecting
  716. Xthe LEFT button will do that command.  Selecting the RIGHT  mouse
  717. Xbutton will give a menu of options to choose from. In most cases,
  718. XHelp is  available and the end of each menu list to help you with
  719. Xthe proper use of Panel Items.
  720. X
  721. XWhen you are asked a yes or no question, choosing either the LEFT
  722. Xor RIGHT mouse buttons is the same as typing "y" or "n".
  723. X%%
  724. X
  725. X%respond%
  726. XThis item responds to mail in 4 ways.
  727. XIn all cases, at least one recipient of your message will be the
  728. Xsender of the message you are responding to. If a subject was in
  729. Xthe author's letter, then it will be used as your subject.
  730. X
  731. XThe first and most used method of response is to the author of the
  732. Xmessage only.  Selecting this item with the LEFT mouse button will
  733. Xuse this method for responding to mail.
  734. X
  735. XIf you want to include a copy of the author's message, then choose
  736. Xthe menu item which  says to include the message.  If you wish for
  737. Xall the recipients of the message to receive a copy of your reply,
  738. Xthen choosing the third item will include them.
  739. X
  740. XThe fourth menu item will mail to the author and everyone listed on
  741. Xthe To and Cc lines of the message, and include the message you are
  742. Xresponding to in your text.
  743. X
  744. XIn such cases where you include the message you are responding to,
  745. Xthe included message will be indented by "> " to identify it from
  746. Xyour message. If you would like to have a string other than the
  747. Xdefault used, then set the appropriate option to whatever you would
  748. Xprefer by selecting the "Opts" item, moving the mouse on top of the
  749. Xstring, "indent-str", selecting the LEFT mouse button and typing the
  750. Xdesired string.
  751. X%%
  752. X
  753. X%menu_respond%
  754. XWhen you respond to a message using the menu item, you respond to the author
  755. Xof the message only. Since there are  more ways to respond to a message, you
  756. Xmay want to choose the  Main Panel Window's Reply item. This item also gives
  757. Xfar more extensive help than described here.
  758. X%%
  759. X
  760. X%menu_delete%
  761. XThis menu may delete or undelete
  762. Xwhichever  message you happen to
  763. Xhave the cursor sitting on.  For
  764. Xdeleting messages  only, you can
  765. Xsimply  select the  MIDDLE mouse
  766. Xbutton  over the message  header
  767. Xyou would like deleted.
  768. X
  769. XFor extensive information on -
  770. X or undeletion of messages
  771. Xtry the the  Main Panel Window's
  772. Xitem for Delete.
  773. X%%
  774. X
  775. X%delete%
  776. XYou may  delete or undelete  messages with this item.
  777. XWhen using the LEFT mouse button, you will delete the
  778. Xcurrent message (HIGHLIGHTED in the headers' window).
  779. XOtherwise, you may select the menu item for undelete.
  780. X
  781. XYou may  delete or undelete a  "range" of messages by
  782. Xtyping the range in the Header Window.
  783. X
  784. XFor help on valid  message ranges, select the menu in
  785. Xthe area  marked "range" in the  Header Panel Window.
  786. X%%
  787. X
  788. X%folder%
  789. XThis item changes your "folder" -- which is  a place to keep all your
  790. Xindividual messages. Usually, if you are a heavy mail user, you would
  791. Xorganize your mail in such a way in which related mail would be saved
  792. Xtogether in one folder.   You create folders simply by saving mail to
  793. Xa filename.  Additional mail can  be saved to those files in the same
  794. Xway.  To manipulate messages in folders,  you "change folders" to the
  795. Xfolder you wish to access using the folder item.   Since it may occur
  796. Xthat you switch  back and forth  between two folders, you may use the
  797. Xprevious  folder menu item which updates changes  made to the current
  798. Xfolder and  changes your  folder to the one previous to  the current.
  799. X
  800. XYou may also select  the exact name of the  folder you wish to access
  801. Xby selecting  the left  mouse button on the "folder"  item and TYPING
  802. Xthe exact  name of the folder  you wish to access.  The "pathname" to
  803. Xthe folder may start with a tilde (~) indicating your home directory.
  804. XOr, it may  contain a plus sign before the  name indicating your Mail
  805. Xdirectory (+reports, for example).  Alternatively, you  can type  '%'
  806. Xto access your system Mailbox, the place where all your mail is first
  807. Xdelivered.  And finally, you can type '#' to indicate  the previously
  808. Xaccessed folder.  See the help for "chdir" for more information.
  809. X%%
  810. X
  811. X%chdir%
  812. XThis is used to just change working directories.
  813. XYour  working directory contains files and other
  814. Xdirectories.  Files can be "mail folders"  which
  815. Xcontain mail  messages.  You can change to other
  816. Xdirectories using some of the following methods:
  817. X
  818. XYou can select from the menu, HOME or Mail, which
  819. Xare your home and default mail directories. Or,
  820. Xselect the left mouse button and TYPE in the name
  821. Xof the directory you would like to change to.
  822. X
  823. XTyped names may have the following syntax:
  824. X
  825. X~[/subpath]   will change to your home directory and
  826. X              a path below that, if specified. Also,
  827. X              you can specify other users: ~username
  828. X+[subpath]    This is your default Mail directory.
  829. X%%
  830. X
  831. X%save%
  832. XYou may save messages in  two ways. The most commonly used method is to
  833. Xsave messages to  your mailbox folder  ("mbox") in your home directory.
  834. XIf you use mail very frequently and save large amounts of mail, you can
  835. Xsave messages to other folders for better organization.
  836. X
  837. XUsually, when messages are saved, mushtool  marks them for deletion for
  838. Xthe next update.  If you don't want to have saved messages deleted, you
  839. Xmust undelete them or set the variable "keepsave" in the options screen.
  840. X
  841. XThere is a text item  in the Main Panel Window which allows you to type
  842. Xthe  name of the file to save a message.  Select the  LEFT mouse button
  843. Xover the "Save" item, and type the filename and hit return. If there is
  844. Xno filename specified, then messages are saved to your mbox file.
  845. X
  846. XYou can specify a range, or group of messages to save by typing a range
  847. Xin the  Header Panel Window.  If there is a  message list in that panel
  848. Xitem, then the range of messages specified there will be saved. If not,
  849. Xthe current message will be saved.
  850. X
  851. XFor additional information, see the help option for Folders.
  852. X%%
  853. X
  854. X%quit%
  855. XThere are various ways in which you may be finished with mailtool.
  856. XThe most commonly used method  is to simply "close" the tool to an
  857. Xiconic form. This means that you haven't really quit, but you have
  858. Xmerely put it on "hold" till later.  It will become an icon on the
  859. Xside or corner of the screen and appear to sit and do nothing.  To
  860. Xclose the tool to icon form, there are two methods which have will
  861. Xhave two different effects.
  862. X
  863. XThe first method is to select  this panel item with the left mouse
  864. Xbutton.  This  will update your current  folder (deleting messages
  865. Xmarked for deletion) and close the tool.  The second method  is to
  866. Xuse the tool manager around the perimeter of the window and select
  867. X"close".  This will close the tool without updating your mailfile.
  868. X
  869. XWhenever the mailtool is  in the "closed"  state, it  periodically
  870. Xchecks your mail and updates your folder with the  new mail. While
  871. Xmailtool is in iconic form, it will display the number of messages
  872. Xyou have in the current folder.
  873. X
  874. XThere are two equally similar methods of exiting  mailtool, rather
  875. Xthan just closing to an icon:  you may select the second menu item
  876. Xin the menu given by this panel item or you may use the tool mana-
  877. X "quit" item.
  878. X
  879. XUsing the tool manager's quit will exit the tool without updating
  880. Xyour folder whereas the panel item's menu selection will have the
  881. Xmailtool prompt you whether to update the current folder or not.
  882. X%%
  883. X
  884. X%help_menu_help_msg%
  885. XSelecting an item within this menu will
  886. Xgive you help on that item. If you want
  887. Xto execute the action, choose the other
  888. Xmenu by placing the mouse over the menu
  889. XBEHIND this menu, continue to keep your
  890. XRIGHT mouse button depressed and select
  891. Xthe LEFT mouse button  over the menu on
  892. Xthe bottom and select that action.
  893. X%%
  894. X
  895. X%msg_menu%
  896. XWhen given menu in the Header Window, you will have a choice
  897. Xof actions to take.  The message may not be the current one,
  898. Xit may be  any message that  appears in  the Headers Window.
  899. XThe "title" of the menu  will indicate which message you are
  900. Xreferring to.
  901. X
  902. XAt this point, you can select actions to take. You can Read,
  903. XDelete, Undelete, Save, Reply to, or Print messages. Most of
  904. Xthese are self explanatory, but if you need help with one of
  905. Xthese, place the  mouse over the menu BEHIND the given menu,
  906. Xcontinue to have the RIGHT mouse button depressed and select
  907. Xthe LEFT mouse button over the Help Menu.
  908. X
  909. XThis action toggles the menus such  that you can change back
  910. Xand forth between these menus. The menu you are on will tell
  911. Xwhich action to take on that message.  In  either case,  you
  912. Xplace the mouse over the action to take, and,  if you are on
  913. Xthe help menu, help will be given regarding that  particular
  914. Xaction. If not in  the help menu,  then that specific action
  915. Xwill actually be taken.
  916. X%%
  917. X
  918. X%edit%
  919. XChoosing this item with the LEFT mouse button in
  920. Xthe Main Panel Window or in the Menu item will
  921. Xallow you to access a full-screen editor. The
  922. Xeditor which you will use is indicated when you
  923. Xselect the "opts" item in the Main Panel Window.
  924. X
  925. XWhile you are typing a letter, you can specify
  926. Xexplicitly which editor to use by typing (on a
  927. Xline by itself) "~v editor". Type "~?" on a line
  928. Xby itself while typing to see a list of valid
  929. X"~commands".
  930. X
  931. XUpon exiting the editor, you can continue typing
  932. Xand even reenter the editor if you like in the
  933. Xsame manner.
  934. X%%
  935. X
  936. X%update%
  937. XThis item will update the current folder you are using.
  938. XChanges are updated to the folder; that is, deleted mail
  939. Xis removed and all other mail is copied back to the folder
  940. Xunless otherwise specified. See the help in "folder" for
  941. Xmore information on folders.
  942. X
  943. XIf new mail has arrived, it will incorporate it. Otherwise,
  944. Xnew mail is incorporated every two minutes or so, if some
  945. Xcomes in.
  946. X%%
  947. X
  948. X%headers%
  949. XThe message headers are displayed in their own separate window.
  950. XThe "current" message is usually displayed in either BOLD or
  951. XREVERSE text. This "highlighted" message is the one which is
  952. Xdisplayed at the bottom, larger window. In the message window,
  953. Xeach message is displayed in the following format:
  954. Xthe message number is displayed first; if it is the "current"
  955. Xmessage, then there is a '>' sign.
  956. XThe next character is the 'status' character:
  957. X    'N' -- New (and unread)
  958. X    'U' -- not new, but still Unread
  959. X    '*' -- delete messages (set show_deleted)
  960. X    'P' -- preserve in spoolfile.
  961. X    'O' -- Old message which has also been Read.
  962. XIf there is just a space (no character), the message is new, but
  963. Xyou've already read it. You should explicitly save or delete these.
  964. X
  965. XFollowing that is the Author of the message and/or all or part of
  966. Xhis network address and login name.  Following that is the number
  967. Xof lines the message is. In quotes is all or part of the "Subject"
  968. X(if one was specified).
  969. X
  970. XTo read a message, select either the READ item in the main panel
  971. Xsubwindow or move the mouse over the message header you want to read
  972. Xand press the LEFT mouse button. Or, the MIDDLE mouse button will
  973. Xdelete that message. Choosing the RIGHT mouse button will give you
  974. Xa menu of things to do then. Included in the menu, is a help item
  975. Xwhich describes the selections in the menu.
  976. X%%
  977. X
  978. X%preserve%
  979. XUsually, after you read mail and you "update" or quit  mailtool, unread
  980. Xmessages are copied back into your system mailbox, deleted messages are
  981. Xremoved, and messages which have been read but not deleted are saved in
  982. Xyour "mbox" file.  Specifying "hold" prevents this from ever happening,
  983. Xbut you can mark specific messages to be held in your system mailbox by
  984. Xpreserving them.
  985. X%%
  986. X
  987. X%compose%
  988. XWhen you start to compose a letter for mailing,
  989. Xyou will be prompted  for the login name(s), of
  990. Xwhom  you want to mail, the (optional)  subject
  991. Xof the message, and an  optional list of carbon
  992. Xcopy recipients.  This is an additional list of
  993. Xlogin names  who will be  mailed copies of your
  994. Xmessage.
  995. X
  996. XAfter that, anything you type will be added to
  997. Xyour  message.  If you select the  RIGHT mouse
  998. Xbutton in the window in  which you are type to
  999. Xget a menu of  things to do.  You may enter an
  1000. Xeditor if your message needs to be modified in
  1001. Xmore detail.
  1002. X
  1003. XWhen you're through with your message, you can
  1004. Xsend it by typing (on a line by itself) "." or
  1005. X^D.  Or, you can select  the Send item  in the
  1006. XMain Panel Window  and your mail will be sent.
  1007. XYou cannot send mail while still in an editor;
  1008. Xyou must exit the editor first.
  1009. X
  1010. XIf you have the option "autoedit" set, you are
  1011. Xautomatically put into an editor when you want
  1012. Xto compose or  whenever you reply to a letter.
  1013. XIn this case, whenever  you're through editing
  1014. Xthe letter, you will be put back into the main
  1015. Xediting mode  where you terminate and send the
  1016. Xletter using any of the above methods.
  1017. X%%
  1018. X
  1019. X%next%
  1020. XYou can page through all your messages by selecting  "Next" after reading
  1021. Xeach message. The same effect is gotten when you select the "Delete" item
  1022. Xwhen the option,  "autoprint" is set to be true  (see "opts") except that
  1023. Xthe current message is deleted before the next one is displayed. Deleting
  1024. Xmail which is  not important  helps the  efficiency of mailtool and reduces
  1025. Xunnecessary use of system resources.
  1026. X
  1027. XIn the Header Window, you will notice the cursor looks like the mouse you
  1028. Xuse.  The blinking buttons on the mouse image remind you that you can use
  1029. Xany of the  three buttons  at any  time.  When you  move the mouse over a
  1030. Xmessage and choose a button, the message under the  mouse is going to be
  1031. Xthe one affected.  Choosing left button will read the message, the middle
  1032. Xbutton will delete it, and the right button will give you a menu.
  1033. X%%
  1034. X
  1035. X%aliases%
  1036. XAliases are used as a method of mailing to users with long addresses using
  1037. Xshort names. For example, if you wanted to mail to
  1038. X    argv@spam.istc.sri.com
  1039. Xbut didn't want to type that all the time, then you could make an alias by
  1040. Xselecting the alias menu item that specifies "adding alias" and then TYPE:
  1041. X    Dan argv@spam.istc.sri.com
  1042. XIf you want to mail to a list of people and do so frequently enough to want
  1043. Xan alias name for the whole list, then  you would type something like this:
  1044. X    project-group fred mary bob@foo-bar herb sly@baz.bitnet
  1045. X
  1046. XTo mail to an "alias" you would compose a letter and address the letter:
  1047. X
  1048. XTo: Dan
  1049. XSubject: Alias example
  1050. XCc: project-group
  1051. X(rest of letter)
  1052. X%%
  1053. X
  1054. X%alts%
  1055. X"Alternates" are alternate names for YOU.  In messages you
  1056. Xreceive, your account will appear on the "To" or "Cc" list.
  1057. XWhen you REPLY to those messages, mailtool will construct
  1058. Xa message header for your letter which will contain the To
  1059. Xand Cc lists of recipients from the original message. You
  1060. Xwould probably want your name taken off the list so you do
  1061. Xnot mail yourself a copy of your own message. If you have
  1062. Xother account names or accounts on other machines, you can
  1063. Xlet mailtool know what those mail addresses are so they can
  1064. Xbe removed from the lists as well.
  1065. X
  1066. XNote, that if YOU add your name MANUALLY (type it yourself)
  1067. Xto either of the lists, it will not be removed.
  1068. X
  1069. XYou can set such a list in your .mailrc file in your home
  1070. Xdirectory by adding the line:
  1071. X
  1072. Xalts hostname1 hostname2 ...
  1073. X
  1074. XIf you prefer to not have your name removed from lists when
  1075. Xresponding to mail, set the option "metoo" and this prevents
  1076. Xthe need for alternates and your name will never be removed.
  1077. X%%
  1078. X
  1079. X%opts%
  1080. XTo set or unset options and their values, move the mouse over
  1081. Xthe option of your choice and select the LEFT button to toggle
  1082. Xtrue/false values. If an option requires a string value, you
  1083. Xmust type the value, so select the LEFT button to reference
  1084. Xthe option, and then type away.  Use a Carriage Return to enter
  1085. Xthe final value for the option.
  1086. X
  1087. XYou may select the RIGHT mouse button anywhere in the window
  1088. Xto give a menu which consists of saving options permanently,
  1089. Xreading in previous settings (from ~/.mailrc), and other things.
  1090. X%%
  1091. X
  1092. X%ignore%
  1093. XWhen reading mail, the message "headers" may clutter up the
  1094. Xwindow with information you are not interested in.  For
  1095. Xexample, you may not be interested in the "Received" or
  1096. X"Message-Id" field of the mail message. You would find that
  1097. Xin time, it will become annoying to see these uninteresting
  1098. Xmessage headers.
  1099. X
  1100. XYou can specify which message headers should not be shown,
  1101. Xthus shortening the appearance of the length of the message.
  1102. X
  1103. XTypical settings:
  1104. X    Received
  1105. X    Message-Id
  1106. X    Status
  1107. X%%
  1108. X
  1109. X%printer%
  1110. XThis item will send the current message, or the message specified on the
  1111. Xmenu header, to the printer. The printer used is given by the "printer"
  1112. Xoption (see opts in Main Panel Window). To specify a different printer,
  1113. Xchange the printer option by selecting the item "Opts" in the Main Panel
  1114. XWindow, moving the mouse over the Printer option, selecting the LEFT
  1115. Xmouse button and typing the name of the printer which you'd like to use.
  1116. X
  1117. XBe sure to set this option before printing because the DEFAULT option may
  1118. Xnot be what you want.
  1119. X
  1120. XYou can print messages that are NOT the current message by moving the
  1121. Xmouse into the Header Window and selecting the RIGHT mouse button on top
  1122. Xof the message you want to print and selecting the PRINT menu option.
  1123. X%%
  1124. X
  1125. X%windows%
  1126. X"Windows" are the boxes which contain items, text, or graphic
  1127. Ximages.  There are two "panel" windows. A panel window is one
  1128. Xwhich contains items,  which are the little boxes  with words
  1129. Xthat you can place the mouse over and click the left or mouse
  1130. Xbutton.
  1131. X
  1132. XEach  window has a separate  function for different purposes.
  1133. XStarting at the top of the main "tool" (contains all windows)
  1134. Xwe have the "header panel." Everything in this panel pertains
  1135. Xto the message headers, only.  The panel in the middle of the
  1136. Xtool is the "mail panel" which is more general and applies to
  1137. Xjust about everything. For a description of each of the items
  1138. Xwithin any panel, select the  "Help"  option  from  the  menu
  1139. Xyou get by selecting the RIGHT mouse button.
  1140. X%%
  1141. X
  1142. X%options%
  1143. XMove the cursor over the option you wish to change.
  1144. XThe LEFT mouse button turns toggles values off and on.
  1145. XThe MIDDLE mouse button displays the meaning of a
  1146. Xvariable. If the option needs typed input, use the LEFT
  1147. Xmouse button.  Sometimes value can be both toggle and
  1148. Xstring values so you may have to click the left button
  1149. Xmore than once to type.  When entering text values, you
  1150. Xmust use RETURN, so the value you typed will be associated
  1151. Xwith the option specified. Unsetting the option will -
  1152. Xassociate the a string value with that option.
  1153. X
  1154. XOnce values are disassociated with options, they can
  1155. Xonly be retrieved by either reentering their values or
  1156. Xby selecting the "restore options" item in the menu.
  1157. XDoing so will read in the last copy of the saved options
  1158. Xfrom your .mailrc file.
  1159. X
  1160. XSelecting the Save option in the menu will save the
  1161. Xcurrent settings in ~/.mailrc.  Selecting the quit
  1162. Xoption in the menu does NOT imply that values are
  1163. Xsaved permanently; changed values will remain through-
  1164. Xout the rest of the mail session.  To save options more
  1165. Xpermanently, select the save menu item.
  1166. X%%
  1167. X
  1168. X%function keys%
  1169. XSelecting the panel item "Opts" with the MENU button will give you
  1170. Xa choice of the type of options you can set. If you choose the one
  1171. Xthat says "function keys", then you can edit the commands that the
  1172. Xfunction keys on the keyboard may execute.  Once in this mode, you
  1173. Xwill find more extensive help.
  1174. X%%
  1175. X
  1176. X%fkeys%
  1177. XUsually the LAST function key in each set (top, left,
  1178. Xand right set of keys) will display the current settings
  1179. Xof all they keys.  The command which does this is 
  1180. X`key_settings X' where X is L, R, or T (left right top)
  1181. Xreferencing the associated function keys.  To set a function
  1182. Xkey to a specific command or set of commands, place the mouse
  1183. Xover the icon image of the key on the screen and click the
  1184. Xleft mouse button.  Type a command from the list of commands
  1185. Xat the bottom of the window and enter RETURN.
  1186. X
  1187. XMany commands take arguments or flags, so be sure to enter
  1188. Xthem here if you want those options. Clicking the middle button
  1189. Xwill display the current value for that key.  If you want to
  1190. Xset a key for multiple commands, separate the commands with
  1191. Xsemicolons:
  1192. X
  1193. XL9:  update ; close
  1194. X
  1195. XThis example would update your mailbox (committing changes)
  1196. Xand close the tool to an icon.
  1197. X%%
  1198. X
  1199. X%message range%
  1200. XYou can specify a large group of messages using a combination of special
  1201. Xsymbols in addition to numbers.  For example, if you wish to save all of
  1202. Xthe messages, then you can use `*' to represent them all. If you were to
  1203. Xtype the  "star" and select the Save  menu option for "save range", then
  1204. Xyou would save ALL the messages you have (including deleted ones).
  1205. X
  1206. XIf you would like to save messages 4 through 9, then you would specify:
  1207. X4-9
  1208. XIf you want to specify the messages between 2 and 32 except for messages
  1209. X6, 8 and message 12-14, you would type:
  1210. X2-32 {6,8,12-14}
  1211. XCommas or spaces can be used to separate numbers.
  1212. X
  1213. XNote that you cannot specify negated messages without first specifying
  1214. Xnormal messages; e.g. {2-5} 1-11   doesn't make sense.
  1215. X%%
  1216. X
  1217. X%sort%
  1218. XSorting messages can   be accomplished by  selecting one  of the
  1219. Xmenu items in this panel item.  By default (using the LEFT mouse
  1220. Xbutton),  sorting is  done by  message status.  New messages are
  1221. Xfirst, followed  by unread messages,  old/read messages, replied
  1222. Xto  messages,  and  finally deleted messages.  You may also sort
  1223. Xmessages by author, date, or subject by selecting the menu item.
  1224. X%%
  1225. END_OF_FILE
  1226. if test 23733 -ne `wc -c <'tool_help'`; then
  1227.     echo shar: \"'tool_help'\" unpacked with wrong size!
  1228. fi
  1229. # end of 'tool_help'
  1230. fi
  1231. echo shar: End of archive 10 \(of 19\).
  1232. cp /dev/null ark10isdone
  1233. MISSING=""
  1234. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ; do
  1235.     if test ! -f ark${I}isdone ; then
  1236.     MISSING="${MISSING} ${I}"
  1237.     fi
  1238. done
  1239. if test "${MISSING}" = "" ; then
  1240.     echo You have unpacked all 19 archives.
  1241.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1242. else
  1243.     echo You still need to unpack the following archives:
  1244.     echo "        " ${MISSING}
  1245. fi
  1246. ##  End of shell archive.
  1247. exit 0
  1248.